#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;

int main() {
    string s1, s2;
    getline(cin, s1);
    getline(cin, s2);
    bool cnt[300] = {0};
    for (char ch : s2) {
        cnt[ch] = true;
    }
    string ans;
    for (char ch : s1) {
        if (!cnt[ch]) {
            ans += ch;
        }
    }
    cout << ans << endl;
    return 0;

}
